<template>
  <div>
    <NestedCollapse :items="items">
      <template v-slot:default="{ item }">
        <NestedCollapse
          v-if="item && item.length"
          :items="item"
        ></NestedCollapse>
      </template>
    </NestedCollapse>
  </div>
</template>

<script>
import NestedCollapse from "./collapse";
export default {
  components: {
    NestedCollapse,
  },
  data() {
    return {
      items: [
        {
          name: "1",
          title: "标题 1",
          content: "这是标题 1 的内容。",
          status: false,
          children: [
            {
              name: "1-1",
              title: "标题 1-1",
              content: "这是标题 1-1 的内容。",
              status: false,
            },
            {
              name: "1-2",
              title: "标题 1-2",
              content: "这是标题 1-2 的内容。",
              status: false,
            },
          ],
        },
        {
          name: "2",
          title: "标题 2",
          content: "这是标题 2 的内容。",
          status: false,
        },
      ],
    };
  },
};
</script>

<style lang="scss" scoped></style>
